home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIAsyncStreamCopier.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  141 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIAsyncStreamCopier.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIAsyncStreamCopier_h__
  6. #define __gen_nsIAsyncStreamCopier_h__
  7.  
  8.  
  9. #ifndef __gen_nsIRequest_h__
  10. #include "nsIRequest.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIInputStream; /* forward declaration */
  18.  
  19. class nsIOutputStream; /* forward declaration */
  20.  
  21. class nsIRequestObserver; /* forward declaration */
  22.  
  23. class nsIEventTarget; /* forward declaration */
  24.  
  25.  
  26. /* starting interface:    nsIAsyncStreamCopier */
  27. #define NS_IASYNCSTREAMCOPIER_IID_STR "eaa49141-c21c-4fe8-a79b-77860a3910aa"
  28.  
  29. #define NS_IASYNCSTREAMCOPIER_IID \
  30.   {0xeaa49141, 0xc21c, 0x4fe8, \
  31.     { 0xa7, 0x9b, 0x77, 0x86, 0x0a, 0x39, 0x10, 0xaa }}
  32.  
  33. class NS_NO_VTABLE nsIAsyncStreamCopier : public nsIRequest {
  34.  public: 
  35.  
  36.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IASYNCSTREAMCOPIER_IID)
  37.  
  38.   /**
  39.      * Initialize the stream copier.
  40.      *
  41.      * @param aSource
  42.      *        contains the data to be copied.
  43.      * @param aSink
  44.      *        specifies the destination for the data.
  45.      * @param aTarget
  46.      *        specifies the thread on which the copy will occur.  a null value
  47.      *        is permitted and will cause the copy to occur on an unspecified
  48.      *        background thread.
  49.      * @param aSourceBuffered
  50.      *        true if aSource implements ReadSegments.
  51.      * @param aSinkBuffered
  52.      *        true if aSink implements WriteSegments.
  53.      * @param aChunkSize
  54.      *        specifies how many bytes to read/write at a time.  this controls
  55.      *        the granularity of the copying.  it should match the segment size
  56.      *        of the "buffered" streams involved.
  57.      *
  58.      * NOTE: at least one of the streams must be buffered.
  59.      */
  60.   /* void init (in nsIInputStream aSource, in nsIOutputStream aSink, in nsIEventTarget aTarget, in boolean aSourceBuffered, in boolean aSinkBuffered, in unsigned long aChunkSize); */
  61.   NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, PRBool aSourceBuffered, PRBool aSinkBuffered, PRUint32 aChunkSize) = 0;
  62.  
  63.   /**
  64.      * asyncCopy triggers the start of the copy.  The observer will be notified
  65.      * when the copy completes.
  66.      *
  67.      * @param aObserver
  68.      *        receives notifications.
  69.      * @param aObserverContext
  70.      *        passed to observer methods.
  71.      */
  72.   /* void asyncCopy (in nsIRequestObserver aObserver, in nsISupports aObserverContext); */
  73.   NS_IMETHOD AsyncCopy(nsIRequestObserver *aObserver, nsISupports *aObserverContext) = 0;
  74.  
  75. };
  76.  
  77. /* Use this macro when declaring classes that implement this interface. */
  78. #define NS_DECL_NSIASYNCSTREAMCOPIER \
  79.   NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, PRBool aSourceBuffered, PRBool aSinkBuffered, PRUint32 aChunkSize); \
  80.   NS_IMETHOD AsyncCopy(nsIRequestObserver *aObserver, nsISupports *aObserverContext); 
  81.  
  82. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  83. #define NS_FORWARD_NSIASYNCSTREAMCOPIER(_to) \
  84.   NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, PRBool aSourceBuffered, PRBool aSinkBuffered, PRUint32 aChunkSize) { return _to Init(aSource, aSink, aTarget, aSourceBuffered, aSinkBuffered, aChunkSize); } \
  85.   NS_IMETHOD AsyncCopy(nsIRequestObserver *aObserver, nsISupports *aObserverContext) { return _to AsyncCopy(aObserver, aObserverContext); } 
  86.  
  87. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  88. #define NS_FORWARD_SAFE_NSIASYNCSTREAMCOPIER(_to) \
  89.   NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, PRBool aSourceBuffered, PRBool aSinkBuffered, PRUint32 aChunkSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aSource, aSink, aTarget, aSourceBuffered, aSinkBuffered, aChunkSize); } \
  90.   NS_IMETHOD AsyncCopy(nsIRequestObserver *aObserver, nsISupports *aObserverContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncCopy(aObserver, aObserverContext); } 
  91.  
  92. #if 0
  93. /* Use the code below as a template for the implementation class for this interface. */
  94.  
  95. /* Header file */
  96. class nsAsyncStreamCopier : public nsIAsyncStreamCopier
  97. {
  98. public:
  99.   NS_DECL_ISUPPORTS
  100.   NS_DECL_NSIASYNCSTREAMCOPIER
  101.  
  102.   nsAsyncStreamCopier();
  103.  
  104. private:
  105.   ~nsAsyncStreamCopier();
  106.  
  107. protected:
  108.   /* additional members */
  109. };
  110.  
  111. /* Implementation file */
  112. NS_IMPL_ISUPPORTS1(nsAsyncStreamCopier, nsIAsyncStreamCopier)
  113.  
  114. nsAsyncStreamCopier::nsAsyncStreamCopier()
  115. {
  116.   /* member initializers and constructor code */
  117. }
  118.  
  119. nsAsyncStreamCopier::~nsAsyncStreamCopier()
  120. {
  121.   /* destructor code */
  122. }
  123.  
  124. /* void init (in nsIInputStream aSource, in nsIOutputStream aSink, in nsIEventTarget aTarget, in boolean aSourceBuffered, in boolean aSinkBuffered, in unsigned long aChunkSize); */
  125. NS_IMETHODIMP nsAsyncStreamCopier::Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, PRBool aSourceBuffered, PRBool aSinkBuffered, PRUint32 aChunkSize)
  126. {
  127.     return NS_ERROR_NOT_IMPLEMENTED;
  128. }
  129.  
  130. /* void asyncCopy (in nsIRequestObserver aObserver, in nsISupports aObserverContext); */
  131. NS_IMETHODIMP nsAsyncStreamCopier::AsyncCopy(nsIRequestObserver *aObserver, nsISupports *aObserverContext)
  132. {
  133.     return NS_ERROR_NOT_IMPLEMENTED;
  134. }
  135.  
  136. /* End of implementation class template. */
  137. #endif
  138.  
  139.  
  140. #endif /* __gen_nsIAsyncStreamCopier_h__ */
  141.